
package com.idealighter.game.games.lkby.handler;

import com.idealighter.game.core.annotation.ResMsgHandler;
import com.idealighter.game.games.lkby.LkbyPlayer;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.robot.core.Player;
import com.idealighter.game.robot.handler.ResMessageHandler;

import java.util.concurrent.TimeUnit;


@ResMsgHandler(521234)
public class ResSwitchSceneHandler implements ResMessageHandler {

  // private static final Logger LOG =
  // LoggerFactory.getLogger(ResSwitchSceneHandler.class);

  @Override
  public void action(Player player, ResMessage message) {
    // ResSwitchSceneMsg msg = (ResSwitchSceneMsg)message;
    LkbyPlayer lkbyPlayer = (LkbyPlayer) player;
    // int fireDelay = RandCodeUtil.random(7, 7);
    int fireDelay = 7;
    lkbyPlayer.pauseFire = true;

    lkbyPlayer.schedule(() -> {
      lkbyPlayer.pauseFire = false;
    }, fireDelay, TimeUnit.SECONDS);

  }
}
